<template>
	<view style="background-color: #f1f1f1;height: 100vh;">
		<view class="two">
			<u--form :model="form" ref="uForm" :rules="rules">
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="单号 :" labelWidth="75" prop="YNUM">
					</u-form-item>
					<u-input disabled  v-model="dataForm.YNUM"/>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="设备 :" labelWidth="75" prop="ITMDES">
					</u-form-item>
					<u-input disabled v-model="dataForm.ITMDES"/>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="申请项目 :" labelWidth="75" prop="YTYPE">
					</u-form-item>
					<!-- <u-input disabled  v-model="dataForm.YSQSYXM"/> -->
				</view>
				<view style="width: 73%;margin: 0 auto;margin-top: -70rpx;margin-left: 170rpx;">
					<uni-data-select disabled v-model="dataForm.YTYPE" :localdata="range8" :clear="false">
					</uni-data-select>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="申请内容 :" labelWidth="75" prop="YDES">
					</u-form-item>
					<u-input disabled  v-model="dataForm.YDES"/>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="申请人 :" labelWidth="75" prop="YSQDNAM">
					</u-form-item>
					<u-input disabled placeholder="请输入" v-model="dataForm.YSQDNAM"/>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="申请时间 :" labelWidth="75" prop="YDAT">
					</u-form-item>
					<u-input disabled placeholder="请输入" v-model="dataForm.YDAT"/>
				</view>
				<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
					<u-form-item label="检验员 :" labelWidth="75" prop="YJYY">
					</u-form-item>
					<u-input disabled placeholder="请输入" v-model="dataForm.YJYY"/>
				</view>
				<view class="two-one">
					<u-form-item style="padding-left: 20rpx;" label="检验师 :" labelWidth="150" prop="YJYY">
					</u-form-item>
				 </view>
				 <view style="width: 80%;margin: 0 auto;margin-top: -70rpx;margin-left: 130rpx;">
				 	<uni-combox v-model="dataForm.YJYS" :candidates="jyylist" 
				 		placeholder="请选择" emptyTips="无数据" 
				 	></uni-combox>
				 </view>
				<view v-if="dataH.YTYPE==2 ">
					<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
						<u-form-item label="材质 :" labelWidth="75" prop="YCZ">
						</u-form-item>
						<u-input placeholder="请输入" v-model="dataForm.YCZ"/>
					</view>
					<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
						<u-form-item label="试样名称 :" labelWidth="75" prop="YSYMC">
						</u-form-item>
					</view>
					<view style="width: 73%;margin: 0 auto;margin-top: -70rpx;margin-left: 170rpx;">
						<uni-data-select @change="changesymc" v-model="dataForm.YSYMC" :localdata="range1" :clear="false">
						</uni-data-select>
					</view>
					<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
						<u-form-item label="焊缝编号 :" labelWidth="75" prop="YSAMPITM">
						</u-form-item>
						<u-input placeholder="请输入" :disabled="dataForm.YSYMC!=1" v-model="dataForm.YSAMPITM"/>
					</view>
					<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
						<u-form-item label="检测位置 :" labelWidth="100" >
						</u-form-item>
					</view>
					<view style="height: 80rpx;width: 73%;margin: 0 auto;margin-top: -65rpx;margin-left: 170rpx;">
						<view class="uni-list-cell-db" style="height: 10rpx;">
							<view class="as-input" @click="openyskxh" style="margin-left: 0rpx;border: 1px solid darkgrey;">
								<view class="placeholder" style="color: darkgrey;"
									v-if="dataForm.YJCWJHD==undefined||dataForm.YJCWJHD==''">
										请选择
								</view>
								<view class="as-content" v-else>{{dataForm.YJCWJHD}}</view>
							</view>
						</view>
						<niceui-popup-select ref="showyskxh"
							v-model="dataForm.YJCWJHD"
							:columns="yskxh"
							:selectValue="yskxhId" :option="{label:'name', value:'id'}"
							@confirm="confirmyskxh">
						</niceui-popup-select>
					</view>
					<view class="two-one" style="width: 95%;margin: 0 auto;margin-top: 20rpx;">
						<u-form-item label="检测时机 :" labelWidth="75" prop="YDETTIM">
						</u-form-item>
					</view>
					<view style="width: 73%;margin: 0 auto;margin-top: -70rpx;margin-left: 170rpx;">
						<uni-data-select v-model="dataForm.YDETTIM" :localdata="range7" :clear="false">
						</uni-data-select>
					</view>
					<view class="two-one" style="width: 50%;margin: 0 auto;margin-top: 10rpx;;margin-left: 20rpx;">
						<u-form-item label="合格指标 :" labelWidth="80" prop="YJCWJHD">
						</u-form-item>
						<u-input  placeholder="请输入" v-model="dataForm.YHGZB1"/>
						<!-- <u-input placeholder="HB/HV" v-model="dataForm.YHGZB2"/> -->
						
					</view>
					<view style="width: 40%;margin: 0 auto;margin-top: -70rpx;margin-left: 400rpx;">
						<uni-data-select v-model="dataForm.YHGZB2" :localdata="range2" :clear="false">
						</uni-data-select>
					</view>
				</view>
				<view v-if="dataH.YTYPE==3 ">
					<view class="two-one" style="width:70%;margin: 0 auto;margin-top: 10rpx;margin-left: 20rpx;">
						<u-form-item label="评定标准(焊缝)" labelWidth="75" prop="YHLQ">
						</u-form-item>
						<u-input placeholder="含量起" v-model="dataForm.YHLQ"/>
						<u-input placeholder="含量止" v-model="dataForm.YHLZ"/>
						
					</view>
					<view style="width: 20%;margin: 0 auto;margin-top: -80rpx;margin-left: 550rpx;">
						<uni-data-select v-model="dataForm.YHLDW" :localdata="range3" :clear="false">
						</uni-data-select>
					</view>
					<view class="two-one" style="width: 70%;margin: 0 auto;margin-top: 20rpx;margin-left: 20rpx;">
						<u-form-item label="评定标准(母材及热影响区)" labelWidth="75" prop="YHLQ">
						</u-form-item>
						<u-input placeholder="含量起" v-model="dataForm.YHLQ2"/>
						<u-input placeholder="含量止" v-model="dataForm.YHLZ2"/>
					</view>
					<view style="width: 20%;margin: 0 auto;margin-top: -80rpx;margin-left: 550rpx;">
						<uni-data-select v-model="dataForm.YHLDW2" :localdata="range3" :clear="false">
						</uni-data-select>
					</view>
				</view>
			</u--form>
			<view v-if="dataH.YTYPE==3 ||  dataH.YTYPE==4">
				<uni-td >
					<u-button type="primary" size="mini" :plain="true"  text="添加"
							 	@click="addData(1)">
					</u-button>
				</uni-td >

			</view>
			<view v-if="dataH.YTYPE==3">
				<view class="table-container" style="margin-left: -20rpx;">
					<uni-table ref="table" border stripe type=""
						emptyText="暂无更多数据" style="height: 650rpx;">
						<uni-tr>
							<uni-th width="100" :sortable="false">操作</uni-th>
							<uni-th align="center" width="150" :sortable="false">试样名称</uni-th>
							<uni-th align="center" width="200" :sortable="false">检查位置</uni-th>
							<uni-th align="center" width="100" :sortable="false">材质/焊材</uni-th>
							<uni-th align="center" width="100" :sortable="false">送样状态</uni-th>
							<uni-th align="center" width="100" :sortable="false">备注</uni-th>
						</uni-tr>
						<uni-tr v-for="(item,index) in tableDataAll" id='index' style="">
							<uni-td >
								<u-button type="warning "  :plain="true" text="删除" @click="deleteData(index)"></u-button>
							</uni-td>
							<uni-td style="" >
								<!-- <uni-data-select v-model="item.YITMREF" :localdata="range5"  :clear="false"></uni-data-select> -->
								<u-input placeholder="请输入" v-model="item.YITMREF" />
							</uni-td>
							<uni-td style="" >
								<!-- <u-input placeholder="请输入" v-model="item.YJCWJD" /> -->
								<!-- <uni-combox v-model="item.YJCWJD" :candidates="yjcwz"
									placeholder="请选择" emptyTips="无数据" 
								></uni-combox> -->
								<uni-data-select v-model="item.YJCWJD" :localdata="yjcwz" :clear="true">
								</uni-data-select>
							</uni-td>
							<uni-td style="" >
								<uni-combox v-model="item.YCZHC" :candidates="yczlist"
									placeholder="请选择" emptyTips="无数据" @input="inputycz(index)"
								></uni-combox>
								<!-- <u-input placeholder="请输入" v-model="item.YCZHC" /> -->
							</uni-td>
							<uni-td style="" >
								<uni-data-select  v-model="item.YSYZTD" :localdata="range6" :clear="true">
								</uni-data-select>
								<!-- <u-input placeholder="请输入" v-model="item.YSYZTD" /> -->
							</uni-td>
							<uni-td style="" >
								<u-input placeholder="请输入" v-model="item.YBZD" />
							</uni-td>
						</uni-tr>
					</uni-table>
					<!-- <view class="uni-pagination-box" style="">
						<uni-pagination show-icon :page-size="pageSize"
							:current="pageCurrent" :total="total"
							@change="change"/>
					</view> -->
				</view>
			</view>
			<view v-if="dataH.YTYPE==4">
				<view class="table-container" style="margin-left: -20rpx;">
					<uni-table ref="table" border stripe type=""
						emptyText="暂无更多数据" style="height: 650rpx;">
						<uni-tr>
							<uni-th width="100" :sortable="false">操作</uni-th>
							<uni-th align="center" width="100" :sortable="false">位置/焊缝</uni-th>
							<uni-th align="center" width="100" :sortable="false">材质/焊材</uni-th>
							<uni-th align="center" width="100" :sortable="false">化学元素</uni-th>
						</uni-tr>
						<uni-tr v-for="(item,index) in tableDataAll" id='index' style="">
							<uni-td >
								<u-button type="warning "  :plain="true" text="删除" @click="deleteData(index)"></u-button>
							</uni-td>
							<uni-td style="" >
								<!-- <uni-data-select :disabled="false" v-model="item.YITMREF" :localdata="range5"  :clear="false"></uni-data-select> -->
								<u-input placeholder="请输入" v-model="item.YITMREF" />
							</uni-td>
							<uni-td style="" >
								<uni-combox v-model="item.YCZHC" :candidates="yczlist"
									placeholder="请选择" emptyTips="无数据" @input="inputycz(index)"
								></uni-combox>
								<!-- <u-input placeholder="请输入" v-model="item.YCZHC" /> -->
							</uni-td>
							<uni-td style="" >
								<u-input placeholder="请输入" v-model="item.YHXYS" />
							</uni-td>
						</uni-tr>
					</uni-table>
					<!-- <view class="uni-pagination-box" style="">
						<uni-pagination show-icon :page-size="pageSize"
							:current="pageCurrent" :total="total"
							@change="change"/>
					</view> -->
				</view>
			</view>
		</view>
		<div >
			<view class="four-item">
				<u-button class="rgzxBox-btn2" type="primary" v-show="this.syqrFlg"
				@click="submit(1)" >提交</u-button>
			</view>
			<view class="four-item">
				<u-button class="rgzxBox-btn2" type="primary" v-show="this.syqrFlg2"
				@click="submit(2)" >转交</u-button>
			</view>
			<view class="four-item">
				<u-button class="rgzxBox-btn2" type="primary" v-show="this.syqrFlg3"
				@click="submit(3)" >确认</u-button>
			</view>
		</div>
	</view>
</template>

<script>
	import { format } from 'date-fns';
	import * as dd from 'dingtalk-jsapi'

	export default {
		data() {
			return {
				dataH:{},
				tableDataAll:[],
				syqrFlg:false,
				syqrFlg2:false,
				syqrFlg3:false,
				dataForm:{},
				form: {

					},
				loading: false,
				rules: {
				},
				test:false,
				YSNUM:'',
				YITMREFNUM:'',
				dataForm:{},
				jyylist:[],
				yczlist:[],
				yskxhId:[],
				yjcwzId:[],
				selected_yskxh:[],
				selected_yjcwz:[],
				yskxh:[
					{id:'母材',name:'母材',},
					{id:'热影响区',name:'热影响区',},
					{id:'焊缝',name:'焊缝',},
				],
				yjcwz:[
					{value:"母材",text:"母材"},
					{value:"坡口",text:"坡口"},
					{value:"焊缝",text:"焊缝"},
					{value:"热影响区",text:"热影响区"},
					
					{value:"母材,坡口",text:"母材,坡口"},
					{value:"母材,焊缝",text:"母材,焊缝"},
					{value:"母材,热影响区",text:"母材,热影响区"},
					{value:"坡口,焊缝",text:"坡口,焊缝"},
					{value:"坡口,热影响区",text:"坡口,热影响区"},
					{value:"焊缝,热影响区",text:"焊缝,热影响区"},
					
					{value:"母材,坡口,焊缝",text:"母材,坡口,焊缝"},
					{value:"母材,坡口,热影响区",text:"母材,坡口,热影响区"},
					{value:"母材,焊缝,热影响区",text:"母材,焊缝,热影响区"},
					{value:"坡口,焊缝,热影响区",text:"坡口,焊缝,热影响区"},
					
					{value:"母材,坡口,焊缝,热影响区",text:"母材,坡口,焊缝,热影响区"},
				],
				range1: [
					{value:"1",text:"焊缝"},
					{value:"2",text:"母材"},
				],
				range2: [
					{value:"HB",text:"HB"},
					{value:"HV",text:"HV"},
				],
				range3: [
					{value:"%",text:"%"},
					{value:"FN",text:"FN"},
				],
				range5: [
				],
				range6: [
					{value:"4",text:"焊缝"},
					{value:"3",text:"母材"},
				],
				range7: [
					{value:"6",text:"-"},
					{value:"1",text:"焊后"},
					{value:"3",text:"热处理后"},
				],
				range8: [
					{value:"1",text:"-"},
					{value:"2",text:"硬度"},
					{value:"3",text:"铁素体"},
					{value:"4",text:"PMI"},
				],
				YCZ:'',
				YS:'',
			}
		},
		onLoad(query) {
			if(query.dataH){
				// 解码 JSON 字符串
				const decodedJsonString = decodeURIComponent(query.dataH);
				// 现在你可以将解码后的字符串解析为 JavaScript 对象
				this.dataH= JSON.parse(decodedJsonString);
			}
			// console.log("dataH",this.dataH)
			this.userInfo = uni.getStorageSync('userInfo');
			this.init();
			this.test = uni.getStorageSync('test')||false;
			this.search();
			this.getjyy();
			this.ADI1054();
			this.getcz();
		},
		mounted() {

		  },
		methods: {
			init(){
			},
			async inputycz(index){
				console.log("index",index)
				this.YCZ=this.tableDataAll[index].YCZHC
				await this.getys()
				const ys=this.YS
				this.tableDataAll[index].YHXYS=ys
				// this.$set(this.tableDataAll, index, ys)
			},
			async getcz(){
				let GRP1 = {
					GRP1:[{
						
					}],
				}
				let res = await this.$api.x3.x3request("WSLISTPMI",GRP1)
				let cusbData = JSON.parse(res.message)
				this.yczlist=[];
				for (var i = 0; i < cusbData.GRP1.length; i++) {
					this.yczlist.push(cusbData.GRP1[i].YCZ)
				}
			},
			async getys(){
				let GRP1 = {
					GRP1:[{
						YCZ:this.YCZ,
					}],
				}
				this.YCZ=''
				this.YS=''
				let res = await this.$api.x3.x3request("WSLISTPMI",GRP1)
				let cusbData = JSON.parse(res.message)
				for (var i = 0; i < cusbData.GRP1.length; i++) {
					this.YS=cusbData.GRP1[0].YS
				}
			},
			async ADI1054() {
				let GRP1 = {
					GRP1: [{
						CODFIC: "ATABDIV",
						IDENT1: "1054",
						ZONE: "LNGDES"
					}]
				}
				let res = await this.$api.x3.x3request("WSLISTAXX",GRP1)
				// 请求成功的处理逻辑
				let resR1 = JSON.parse(res.message)
				this.axxList= resR1.GRP1
				this.range5=[]
				var newObject={}
				for (var i = 0; i < this.axxList.length; i++) {
					newObject = { value: this.axxList[i].IDENT2, text: this.axxList[i].TEXTE};
					this.range5.push(newObject)
				}
			},
			deleteData(index){
				var that_=this
				uni.showModal({
				  title: '提示',
				  content: '是否删除行？',
				  success: function (res) {
				    if (res.confirm) {
				      // 用户点击确定按钮
				      that_.tableDataAll.splice(index, 1);
				    } else if (res.cancel) {
				      // 用户点击取消按钮
				      //this_.submitData(q,1);
				    }
				  }
				});
			
			},
			addData(e){
				for(var i=0;i<e;i++){
					const newData = {
						YITMREF: '' ,
						YJCWJD: '' ,
						YCZHC: '' ,
						YSYZTD: '' ,
						YBZD: '' ,
						YHXYS: '' ,
						};
					this.tableDataAll = [...this.tableDataAll, newData];
				}
			},
			async getjyy(){
				let GRP1 = {}
				let res = await this.$api.x3.x3request("WSLISTYDR2",GRP1)
				let cusbData = JSON.parse(res.message)
				this.jyylist=[];
				for (var i = 0; i < cusbData.GRP1.length; i++) {
					this.jyylist.push(cusbData.GRP1[i].NAME)
				}
			},
			changesymc(e){
				if(e==2){
					this.dataForm.YSAMPITM='/'
					this.dataForm.YJCWJHD='母材'
				}
			},
			openyskxh(){
				if(this.dataForm.YSYMC==2){return}
			    this.$refs.showyskxh.showPopup()
			},
			openyjcwz(){
				// if(this.dataForm.YSYMC==2){return}
			    this.$refs.showyjcwz.showPopup()
			},
			confirmyskxh(value,data) {
				this.yskxhId = value
				this.dataForm.YJCWJHD=data.map(it => it.name).join(', ');
				this.selected_yskxh = data
				this.$refs.showyskxh.closePopup()
			},
			confirmyjcwz(value,data) {
				console.log("confirmyjcwz-va",value)
				console.log("confirmyjcwz-da",data)
				return
				this.yjcwzId = value
				this.dataForm.YJCWJD=data.map(it => it.name).join(', ');
				this.selected_yjcwz = data
				this.$refs.showyjcwz.closePopup()
			},
			async search(){
				let GRP1 = {
					GRP1: [{
						YFLG: this.dataH.YFLG,
						YNUM: this.dataH.YNUM,
						}]
				}
				let GRP1Json = JSON.stringify(GRP1)
				let res = await this.$api.x3.x3request("WSLISTPCTD",GRP1)
				let curData=JSON.parse(res.message);
				console.log("curData",curData)
				if (curData.GRP3.WOK!=0){
					uni.showToast({
					   title: curData.GRP3.WRESULT,
					   icon: 'error',
					   duration: 2000
					});
					return
				}
				this.dataForm=curData.GRP1;
				this.tableDataAll=curData.GRP2;
				if (this.dataH.YFLG==1){
					this.syqrFlg=true;
					this.syqrFlg2=true;
				}
				if (this.dataH.YFLG==3){
					this.syqrFlg3=true;
				}
			},
			submit(q) {
				if(q==2){//转交
					this.dataH.YJYY=this.dataForm.YJYY
					uni.navigateTo({url:"/pages/dzzxPages/dzzxuPages?dataH="+JSON.stringify(this.dataH)})
					return
				}
				var this_ = this
				uni.showModal({
				  title: '提示',
				  content: '是否确认？',
				  success: function (res) {
				    if (res.confirm) {
				      this_.submitData(q);
				    }
				  }
				});
			},
			async submitData(param) {
				if(param==1){
					if(undefined==this.dataForm.YJYY || this.dataForm.YJYY==''){
						uni.$u.toast('检验师必填')
						return
					}
					
					if(this.dataForm.YTYPE==2){
						if(undefined==this.dataForm.YCZ || this.dataForm.YCZ==''){
							uni.$u.toast('材质必填')
							return
						}
						if(undefined==this.dataForm.YSAMPITM || this.dataForm.YSAMPITM==''){
							uni.$u.toast('焊缝编号必填')
							return
						}
						if(undefined==this.dataForm.YJCWJHD || this.dataForm.YJCWJHD==''){
							uni.$u.toast('检测位置必填')
							return
						}
					}
					if(this.dataForm.YTYPE==3){
						for(let i=0;i<this.tableDataAll.length;i++){
							if(undefined==this.tableDataAll[i].YITMREF || this.tableDataAll[i].YITMREF==''){
								uni.$u.toast('试样名称必填')
								return
							}
							if(undefined==this.tableDataAll[i].YJCWJD || this.tableDataAll[i].YJCWJD==''){
								uni.$u.toast('检测位置必填')
								return
							}
							if(undefined==this.tableDataAll[i].YCZHC || this.tableDataAll[i].YCZHC==''){
								uni.$u.toast('材质/焊材必填')
								return
							}
							if(undefined==this.tableDataAll[i].YSYZTD || this.tableDataAll[i].YSYZTD==''){
								uni.$u.toast('送样状态必填')
								return
							}
						}
					}
					if(this.dataForm.YTYPE==4){
						for(let i=0;i<this.tableDataAll.length;i++){
							if(undefined==this.tableDataAll[i].YITMREF || this.tableDataAll[i].YITMREF==''){
								uni.$u.toast('位置/焊缝必填')
								return
							}
							if(undefined==this.tableDataAll[i].YCZHC || this.tableDataAll[i].YCZHC==''){
								uni.$u.toast('材质/焊材必填')
								return
							}
						}
					}
				}
			
				let GRP1 = {
					GRP1: [],
					GRP2:[]
				}
				if(param==1){
					GRP1.GRP1.push({
						YFLG:param,
						YNUM:this.dataForm.YNUM,
						YSQDNAM:this.userInfo.NAME,
						YTYPE:this.dataForm.YTYPE,
						YJYS:this.dataForm.YJYS,
						})


					if(this.dataForm.YTYPE==2){
						GRP1.GRP1[0].YCZ=this.dataForm.YCZ
						GRP1.GRP1[0].YSYMC=this.dataForm.YSYMC+""
						GRP1.GRP1[0].YSAMPITM=this.dataForm.YSAMPITM
						GRP1.GRP1[0].YJCWJHD=this.dataForm.YJCWJHD
						GRP1.GRP1[0].YHGZB1=this.dataForm.YHGZB1
						GRP1.GRP1[0].YHGZB2=this.dataForm.YHGZB2
						GRP1.GRP1[0].YDETTIM=this.dataForm.YDETTIM
					}
					if(this.dataForm.YTYPE==3){
						GRP1.GRP1[0].YHLQ=this.dataForm.YHLQ
						GRP1.GRP1[0].YHLZ=this.dataForm.YHLZ
						GRP1.GRP1[0].YHLDW=this.dataForm.YHLDW
						GRP1.GRP1[0].YHLQ2=this.dataForm.YHLQ2
						GRP1.GRP1[0].YHLZ2=this.dataForm.YHLZ2
						GRP1.GRP1[0].YHLDW2=this.dataForm.YHLDW2
						for(let i=0;i<this.tableDataAll.length;i++){
							var yitm=this.tableDataAll[i].YITMREF
							var yitmnam=''
							for(let j=0;j<this.range5.length;j++){
								if(this.range5[j].value==this.tableDataAll[i].YITMREF){
									yitm=this.range5[j].value
									yitmnam=this.range5[j].text
									break
								}
							}
							GRP1.GRP2.push({
								YITMREFNUM: this.tableDataAll[i].YITMREF,
								YITMREF: yitmnam,
								YJCWJD: this.tableDataAll[i].YJCWJD,
								YCZHC: this.tableDataAll[i].YCZHC,
								YSYZTD: this.tableDataAll[i].YSYZTD,
								YBZD: this.tableDataAll[i].YBZD,
							})
						}
					}
					if(this.dataForm.YTYPE==4){
						for(let i=0;i<this.tableDataAll.length;i++){
							// var yitm=this.tableDataAll[i].YITMREF
							// var yitmnam=''
							// for(let j=0;j<this.range5.length;j++){
							// 	if(this.range5[j].value==this.tableDataAll[i].YITMREF){
							// 		yitm=this.range5[j].value
							// 		yitmnam=this.range5[j].text
							// 		break
							// 	}
							// }
							GRP1.GRP2.push({
								// YITMREFNUM: this.tableDataAll[i].YITMREF,
								YITMREF: this.tableDataAll[i].YITMREF,
								YCZHC: this.tableDataAll[i].YCZHC,
								YHXYS: this.tableDataAll[i].YHXYS,
							})
						}
					}
				}
				if(param==3){
					GRP1 = {
					  	GRP1: [{
								YFLG:param,
								YNUM:this.dataForm.YNUM,
								YSQDNAM:this.userInfo.NAME,
					  	}]
					}
				}
				console.log(GRP1,'GRP1');
				let res = await this.$api.x3.x3request("WSGENPCTZ",GRP1)
				console.log(res,'res');
				let resR = JSON.parse(res.message)
				if(resR.GRP3.WOK==0){
					// 显示创建成功的消息提示
					// uni.showToast({
					//    title: '提交成功:'+resR.GRP3.WRESULT,
					//    icon: 'success',
					//    duration: 2000
					// });
					uni.$u.toast('提交成功:'+resR.GRP3.WRESULT)
					let that = this
					this.form =''
					this.dataForm=''
					this.tableData=[]
					this.tableDataAll=[]
					uni.showToast({
						   title: '成功:'+resR.GRP3.WRESULT,
						   icon: 'success',
						   duration: 2000
						});
					setTimeout(function() {
						uni.switchTab({url:"/pages/managementCenter/managementCenter"})
					}, 2000);
				}else{
					uni.showToast({
					   title: '提交失败',
					   icon: 'error',
					   duration: 2000
					});
				}
			},
		}
	}
</script>

<style>
.top{
	height: 100rpx;
	line-height: 100rpx;
	color: #13d5f6;
}
.two{
	background-color: white;
}
.two-one{
	overflow: hidden;
	margin-top: 20rpx;
	display: flex;
	justify-content: space-between;
}
.two-oneLeft{
	width: 190rpx;
	color: gray;
	text-align: right;
}
.two-oneRight{
	width: 350rpx;
	color: gray;
	text-align: left;
	margin-left: 10rpx;
}
.two-one1{
	overflow: hidden;
	margin-top: 20rpx;
	display: flex;
}
.two-oneLeft1{
	width: 200rpx;
	color: gray;
	text-align: right;
}
.two-oneRight1{
	color: gray;
	text-align: left;
	margin-left: 10rpx;
}
.there{
	height: 100rpx;
	line-height: 100rpx;
	color: #13d5f6;
}
.four{
	height: 120rpx;
	background-color: white;
}
.four-one{
	height: 60rpx;
	display: flex;
	justify-content: space-between;
}
.four-oneLeft{
	width: 190rpx;
	line-height: 68rpx;
	color: gray;
	text-align: right;
}
.four-oneRight{
	width: 350rpx;
	line-height: 68rpx;
	color: gray;
	text-align: left;
}
.five{
	height: 100rpx;
	line-height: 100rpx;
	color: #13d5f6;
}
.sixBox{
	height: 70rpx;
	background-color: white;
	line-height: 37rpx;
	padding-left: 40rpx;
	margin-bottom: 20rpx;
}
.four-item{
	width: 90%;
	margin-top: 16rpx;
	margin-left: 40rpx;
}
</style>
